package com.qf.day06.Homework;

import java.util.Random;

public class Son extends  Hero{
    private int anger;//怒气

    public int getAnger() {
        return anger;
    }

    public void setAnger(int anger) {
        this.anger = anger;
    }



    public Son(String name, int power, int intelligence, int agile, int anger) {
        super(name, power, intelligence, agile);
        this.anger = anger;
    }

    public  void  dj(){
        this.anger = this.anger-20;
        int power1 = getPower();
        Random r = new Random();
        double min = power1 *0.8;
        double max = power1+ power1*0.2;
        double randomFloat = generateRandomFloat(min, max)*2;
        System.out.println(getName()+"的攻击力是"+randomFloat+"怒气值是："+anger);
    }

    @Override
    public String toString() {
        return "Son{" +
                "anger=" + anger +
                ", power=" + power +
                '}';
    }
}
